package com.xiaosu.red_travel.mapper;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xiaosu.red_travel.constant.Code;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("tab_comment")
public class Comment {

    @TableId(type = IdType.AUTO)
    private Integer id;

    @NotNull(message = Code.IDNOTNULL)
    private Integer uid;

    @NotNull(message = Code.ROUTEIDNOTNULL)
    private Integer rid;

    @TableField(exist = false)
    private User user;

    @NotNull(message = Code.CONTENTNOTNULL)
    private String content;

    @NotNull(message = "评论时间不能为空")
    private String time;

}
